import request from '@/utils/request-student'

/**
 * 用户登录
 * @param {Object} data 登录信息
 * @returns {Promise}
 */
export function login(data) {
  return request({
    url: '/student/auth/login',
    method: 'post',
    data
  })
}

/**
 * 获取当前登录用户信息
 * @returns {Promise}
 */
export function getUserInfo() {
  return request({
    url: '/student/auth/userInfo',
    method: 'get'
  })
}

/**
 * 修改用户密码
 * @param {Object} data 密码信息 
 * currentPassword: current,
 * newPassword: newpwd
 * @returns {Promise}
 */
export function changePassword(data) {
  return request({
    url: '/student/auth/changePassword',
    method: 'post',
    data
  })
} 